package springcloud_eureka_bus_client.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope	//该注解表示在接到配置中心配置刷新的时候，自动将新的配置更新到该类对应的字段中
public class ClientController {
	
	@Value("${word}")	//从配置文件获取参数
	private String word;
	
    @RequestMapping("/hello")
    //@RequestParam获取前端参数
    public String index(@RequestParam String name) {
        return name+","+this.word;
    }
}